<template>
  <view>
    <text @tap="open">选择省/市/区</text>
      <!-- <button @tap="open">打开</button> -->
    <!-- <uni-popup height="600px" id="popup" ref="popup" :type="type_status" :animation="true" mode="bottom" :safe-area-inset-bottom="true"> -->
        <cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm" @cancel="cancel" :visible="visible"/>
    <!-- </uni-popup> -->
    <!-- <view>{{str}}</view> -->
  </view>
</template>

<script>
  import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
  export default {
      data() {
          return {
              visible: false,
              maskCloseAble: true,
              str: '',
              defaultValue: '',
              // defaultValue: ['河北省','唐山市','丰南区'],
              column: 3
          }
      },
      components: {
          cityPicker
      },
      methods: {
          open () {
              this.visible = true
            //   this.$refs.popup.open()
          },
          confirm (val) {
              console.log(val)
              this.str = JSON.stringify(val)
              this.visible = false
          },
          cancel () {
              this.visible = false
          }
      },
      onShareAppMessage(res) {
          if (res.from === 'button') { // 来自页面内分享按钮
              console.log(res.target)
          }
          return {
              title: 'data-cityPicker省市区地址选择器！',
              path: '/pages/cityPicker/cityPicker'
          }
      },
      onShareTimeline(res) {
          if (res.from === 'button') { // 来自页面内分享按钮
              console.log(res.target)
          }
          return {
              title: 'data-cityPicker省市区地址选择器！'
          }
      }
  }
</script>

<style lang="scss">

</style>